

(function(abm, undefined) {
    //Public Property
    var utils = {};
    utils.currentViewPort = {};
    utils.debug = true;
    utils.log = function(value) {
        if (utils.debug) {
            console.log("ABM Utility Log : " + value);
        }
    };

    utils.getViewPort = function() {
        var e = window, a = 'inner';
        if (!('innerWidth' in window)) {
            a = 'client';
            e = document.documentElement || document.body;
        }
        utils.currentViewPort = {width: e[ a + 'Width' ], height: e[ a + 'Height' ]};
        utils.log('Current viewPort : ' + utils.currentViewPort.height + " x " + utils.currentViewPort.width);
        return utils.currentViewPort;
    };
    utils.httpRedirect = function(url) {
        try {
            if (url.length > 0) {
                utils.log("Redirecting User Agent to - \"" + url + "\"");
                window.location.replace(url);
            }
        } catch (err) {
            utils.log("URL should not be null");
        }
    };
    utils.getParam = function(name) {
        utils.log("Searching for the GET parameter : " + name);
        var parameterAvalue = decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
        utils.log("GET parameter value : " + parameterAvalue);
        return parameterAvalue;
    };

    utils.navgiateTo = function(url) {
        utils.ajaxParamName + "=" + utils.ajaxParamContentValue;

    }

    //
    //
    // Computing current view port on script loading.
    //

    (function() {
        if (window.attachEvent) {
            window.attachEvent('onresize', function() {
                utils.getViewPort();
            });
        }
        else if (window.addEventListener) {
            window.addEventListener('resize', function() {
                utils.getViewPort();
            }, true);
        }
        utils.getViewPort();
        utils.log("Window resize is being tracked and updated to \"utils.currentViewPort\"");
        utils.log("\"utilsutils\" is loaded and up for action.");
    }());
    window.abm.utils = utils;
})(window.abm = window.abm || {});